#pragma once
#include "DO.h"
#include "ASN.h"
#include <fstream>
#include <list>

namespace aps {
#define FAILURE 0
#define SUCCESS 1 

using namespace std;

ref class PassportInfo {
protected:
	System::Data::Odbc::OdbcConnection ^connection;
	System::Data::Odbc::OdbcCommand ^command;
	System::Data::Odbc::OdbcDataReader ^Reader;
	System::String ^query;
public:
	char* server;
	char* user;
	char* password;
	char* database;
	void setConnection(void);
	void freeConnection(void);
	PassportInfo(void);
	int getTruncatedName(const char* fileNo, BYTE* name);
	int getDocNumber(const char* fileNo, BYTE* docNum);
	int getNationality(const char* fileNo, BYTE* nation);
	int getDOB(const char* fileNo, BYTE* dob);
	int getSex(const char* fileNo, BYTE* sex);
	int getDOE(const char* fileNo, BYTE* doe);
	int getFullName(const char* fileNo, BYTE* fullName);
	int getNumOtherNames(const char* fileNo, BYTE* others, int* sizebuf);
	int getOtherName(const char* fileNo, BYTE* otherName, int i);
	int getFullDOB(const char* fileNo, BYTE* fullDOB);
	int getPlaceBirth(const char* fileNo, BYTE* placeBirth);
	int getPermAddr(const char* fileNo, BYTE* addr);
	int getIssueAuth(const char* address, BYTE* issueAuth);
	int getDateIssue(const char* fileNo, BYTE* dateIssue);
	int getTimestampPers(const char* fileNo, BYTE* dttimePers);
	int getPlaceIssue(const char* fileNo, BYTE* placeIssue);
	int getFathersName(const char* fileNo, BYTE* fname);
	int getMothersName(const char* fileNo, BYTE* mname);
	int getSpouseName(const char* fileNo, BYTE* sname);
	int getOldPassportNum(char* fileNo, char* passNum);
};
}